package com.winchain.chainbill.bill.biz.transfer.cmd;

import com.shell.framework.command.CommandContext;
import com.shell.framework.command.ICommand;
import com.winchain.chainbill.bill.base.po.CbRec;
import com.winchain.chainbill.bill.base.service.CbRecService;
import com.winchain.chainbill.bill.biz.Bill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class BillRecCmd<T> implements ICommand<Bill<T>> {
	@Autowired
	private CbRecService cbRecService;

	public boolean execute(CommandContext<Bill<T>> context) throws Exception {
		CbRec record = ((Bill) context.getSource()).getRec();
		this.cbRecService.saveOrUpdate(record);

		return false;
	}
}
